package com.summer.safe.exception;

import com.summer.safe.config.result.ResultCode;

/**
 * 自定义异常
 */
public class CustomException extends RuntimeException {


    /**
     * 返回的消息
     */
    private String code;

    /**
     * 返回的消息
     */
    private String msg;

    /**
     * 错误的消息
     */
    private String error;

    public CustomException(ResultCode returnCode) {
        this.msg=(returnCode.getMsg());
        this.code = returnCode.getCode();
    }
    public CustomException(ResultCode returnCode,String error) {
        this.msg=(returnCode.getMsg());
        this.code = returnCode.getCode();
        this.error = error;
    }

    public CustomException(String code,String msg){
        this.code = code;
        this.msg=msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }
}
